package com.neuralnoise.livejournal;

import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;

public class LiveJournalProperties {

	private static final String DEFAULT_PROPERTIES_FILENAME = "livejournal.properties";
	
	private String username;
	private String password;
	private String startNode;
	private long millis;
	
	public LiveJournalProperties(String fileName) throws ConfigurationException {
		Configuration config = new PropertiesConfiguration(fileName);
		this.setUsername(config.getString("livejournal.username"));
		this.setPassword(config.getString("livejournal.password"));
		this.setStartNode(config.getString("livejournal.startNode"));
		this.setMillis(config.getLong("livejournal.millis"));
	}

	public LiveJournalProperties() throws ConfigurationException {
		this(DEFAULT_PROPERTIES_FILENAME);
	}
	
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getStartNode() {
		return startNode;
	}

	public void setStartNode(String startNode) {
		this.startNode = startNode;
	}
	
	public Long getMillis() {
		return millis;
	}

	public void setMillis(long l) {
		this.millis = l;
	}
	
}
